import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class EITerapeutakKudeatu extends JFrame {

	private JPanel contentPane;
	private JButton btnLogout;
	private JButton btnAtzera;
	private JButton btnGehitu;
	private JButton btnBilatu;
	private JLabel lblTerapeutaKudeatzailea;

	public EITerapeutakKudeatu() {
		elementuakHasieratu();
		botoiakHasieratu();
		setVisible(true);
	}
	
	public void elementuakHasieratu(){
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 900, 600);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		btnBilatu = new JButton("TERAPEUTA BILATU");
		btnBilatu.setBounds(356, 158, 206, 67);
		contentPane.add(btnBilatu);
		
		btnGehitu = new JButton("TERAPEUTA GEHITU");
		btnGehitu.setBounds(356, 259, 206, 67);
		contentPane.add(btnGehitu);
		
		btnLogout = new JButton("Logout");
		btnLogout.setBounds(787, 12, 93, 25);
		contentPane.add(btnLogout);
		
		btnAtzera = new JButton("Atzera");
		btnAtzera.setBounds(763, 520, 117, 25);
		contentPane.add(btnAtzera);
		
		lblTerapeutaKudeatzailea = new JLabel("TERAPEUTA KUDEATZAILEA");
		lblTerapeutaKudeatzailea.setFont(new Font("Dialog", Font.BOLD, 16));
		lblTerapeutaKudeatzailea.setBounds(331, 67, 256, 47);
		contentPane.add(lblTerapeutaKudeatzailea);
	}
	
	public void botoiakHasieratu(){
	
		btnLogout.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				EILogin frame = new EILogin();
				EITerapeutakKudeatu.this.dispose();
			}
		});
		
		btnAtzera.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				if (EILogin.administratzailea){
					EIAdministratzailea frame = new EIAdministratzailea();	
				}else{
					EIIdazkari frame = new EIIdazkari();	
				}
				EITerapeutakKudeatu.this.dispose();
			}
		});
		
		btnGehitu.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				EITerapeutaGehitu frame = new EITerapeutaGehitu();
				EITerapeutakKudeatu.this.dispose();
				
			}
		});
		
		btnBilatu.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				EITerapeutaBilatu frame = new EITerapeutaBilatu();
				EITerapeutakKudeatu.this.dispose();
				
			}
		});
	}

}

